#! /usr/bin/env python

from dynamic_reconfigure.parameter_generator_catkin import *


PACKAGE = 'image_proc'
ID = 'Resize'

gen = ParameterGenerator()

interpolate_enum = gen.enum([gen.const('NN', int_t, 0, 'Nearest neighbor'),
                             gen.const('Linear', int_t, 1, 'Linear'),
                             gen.const('Cubic', int_t, 2, 'Cubic'),
                             gen.const('Lanczos4', int_t, 4, 'Lanczos4')],
                            'interpolation type')
gen.add('interpolation', int_t, level=0,
        description='Interpolation algorithm between source image pixels',
        default=1, min=0, max=4, edit_method=interpolate_enum)

gen.add('use_scale', bool_t, level=0,
        description='Flag to use scale instead of static size.',
        default=True)
gen.add('scale_height', double_t, level=0,
        description='Scale of height.',
        default=1, min=0, max=10)
gen.add('scale_width', double_t, level=0,
        description='Scale of width',
        default=1, min=0, max=10)

gen.add('height', int_t, level=0,
        description='Destination height. Ignored if negative.',
        default=-1, min=-1)
gen.add('width', int_t, level=0,
        description='Destination width. Ignored if negative.',
        default=-1, min=-1)

exit(gen.generate(PACKAGE, PACKAGE, ID))
